package strain.domain;

import java.util.Collection;

import strain.expression.BaseExpression;
import strain.expression.RealExpression;

public class RealDomain extends BaseExpression<Double, RealDomain> implements RealExpression, Domain<Double> {

    private final EnumDomain<Double> domain;
    
    public RealDomain(final Collection<Double> values){
        this.domain = new EnumDomain<Double>(values);
    }
    
    public RealDomain getDomain() {
        return this;
    }

    public boolean isBound() {
        return this.domain.isBound();
    }

    public Double getBoundValue() {
        return this.domain.getBoundValue();
    }

    public boolean bind(final Double value) throws InconsistentDomainException {
        return this.domain.bind(value);
    }

    public boolean retain(final RealDomain values) throws InconsistentDomainException {
        return this.domain.retain(values.domain);
    }

    public boolean remove(final RealDomain values) throws InconsistentDomainException {
        return this.domain.remove(values.domain);
    }

    public boolean remove(final Double value) throws InconsistentDomainException {
        return this.domain.remove(value);
    }

    public boolean propagate() {
        return false;
    }
    
    @Override
    public String toString(){
        return "Real[" + this.id + "]:" + this.domain.set;
    }

}
